Restore functionality where ellipsizing label *minimum* size grows to "max-char-width".
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Sun, 18 Apr 2010 03:06:24 +0000 (23:06 -0400)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Sun, 18 Apr 2010 03:06:24 +0000 (23:06 -0400)
gtk/gtklabel.c

index 07546a3250ea21f777aaa485a7a82cfad0dcfcb8..911b790e2e7c21c0d157e8fce847baf2a89f7122 100644 (file)
@@ -2994,6 +2994,15 @@ get_label_char_width (GtkLabel *label,
          gint max_char_width = char_pixels * priv->max_width_chars;
          gint max_width      = MIN (text_width, max_char_width);
 
+         /* With max-char-width specified, we let the minimum widths of 
+          * ellipsized text crawl up to the max-char-width
+          * (note that we dont want to limit the minimum width for wrapping text).
+          */
+         if (label->ellipsize)
+           {
+             *minimum = MIN (text_width, max_width);
+           }
+
          *natural = MAX (rect.width, max_width);
        }
    }